package com.ruoyi.web.core.config;

import com.github.wxpay.sdk.WXPayConfig;
import lombok.extern.slf4j.Slf4j;

import java.io.IOException;

/**
 * 骉马商户号配置类
 */
@Slf4j
public class BiaomaConfig extends WechatConfig {
    /**
     * 天蛙小程序appId
     */
    public static final String APPID = "wxd602e0793295cc28";

    /**
     * 天蛙小程序密钥
     */
    public static final String SECRET = "7ec0b59e73b75b7388bd0323f1d29955";

    /**
     * 骉马商户号
     */
    public static final String MCHID = "1610603356";

    /**
     * 骉马商户密钥 --- 同 API V3 密钥
     */
    public static final String KEY = "43872bdeb8f2c9f57036a0a36cbb915a";

    /**
     * 骉马 API V3 秘钥
     */
    public static final String API_V3_KEY = "43872bdeb8f2c9f57036a0a36cbb915a";


    public static final String BODY = "智能物联";

    public static final  String DESC = "智能物联分润到账";

    /**
     * 骉马支付分充电宝服务号
     */
    public static final String SERVICE_ID = "00002000000000162373215080431680";

    /**
     * 支付分签名方式
     */
    public static final String SIGN_TYPE = "HMAC-SHA256";

    /**
     * 金额环回说明
     */
    public static final String REFUND_DESC = "智能物联，余额退还";

    /**
     * 骉马商户api证书序列号
     * https://myssl.com/cert_decode.html 证书解析地址
     */
    public static final String SERIAL_NO = "77094FA0BCFEE2301DA7F98931740504EB1B6246";

    /**
     * 骉马证书内容  apiclient_key.pem文件中的内容 除去开头结尾行
     *  请求量大为节约资源直接拿出来
     */
    public static final String PRIVATE_CONTENT = "MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQDRBl0kZ4LDuBrU" +
            "mX16MjlrORXYobqcJbh6t6cQT3JBq9319lieVY9wEwJAK0KgA4s1sRm3fNAxmmjL" +
            "dyVlLr6oas5MW+4QcEXpiqXRKlPiKy4ZESSuerbvyjhbJUJV5x3lyUTW9xxzfYMA" +
            "eHL46BFB4a+aHhblcQQ/zkVxCto3wwfr5rlpd+0jS4COtFi3ILJ65EcCS+Av+d59" +
            "WtzPYTmou2lFVaSacpH6ZNf+a9kEWyWk7gzdSVCvFXq+YS4OxSEGjLU5tWuSXpez" +
            "Oqv69C1vL2D01vCfickWA9FvcXJWcfJCw8eL5ASGcIYajpkv/RIb1UxxmHBWMQOx" +
            "RUp3RnulAgMBAAECggEAQIJYSJ3xi3nMPgTI5ueNNPw/M8ZmEz7I+oandq8uMfpa" +
            "3EgU/Ximdg5HyYoQW9X8JqvrpedNUaG36eNxlRKiINQlqwdMJ6Ke0P7LQgxwKwLs" +
            "jSvvSDHzN3oPfoG3QU+8uGgvaLCHBVWdEo4Z3Zuxh8WhLk1O/6yrhQ2h/Ms+oapu" +
            "M+ePaW9gJ0iNatpkvXmta5ye/JS84eKEna+5/VrcXOh/ldhHW7YXLfpMzQToobqp" +
            "DA6jXpZcWyTSsK9XVdsKn8YJwaGR+ePzOxpdedTyaYZhvT0xN/DdXTZqaWnHeaAl" +
            "Qo4zJ9MFd2gHMWTxodMSvTTdbt7Do3UPZZA5nEfKQQKBgQD3OvbBOV5fFzTp+q64" +
            "sr7gz7Vjdg2lR2/4WSd33nozzZ/Iby8+A1A3ATSjpAj4hpsG51JfN3IBCwf13LRb" +
            "Ej0ThffQxj6+VbVvy1AnNNFHLO/ogjEKC07s+sZREQgDus/FWUWqYmA3BoXkbs9a" +
            "lpllsL9CHUf9v8KfBTFgXpnGrQKBgQDYcHc7B4lyn7XUU5M2DfiG5nfJFFwVAWeR" +
            "InMjkRQPWf7w+eUgSyyLrTPQhgF/ocf7nwHtuivsd4+vfbw2/JpF0MSQg59V/JEX" +
            "62OjejBp/JLqIzn0yob81hxR0ZAGS/Mxtn3qQWizUdODJkpH9KMg4l7VzmakObkC" +
            "CodoOrq/2QKBgQDVayMjveBHegMFkI9PhY3dB7DvwTMaYEa6Pkwh3/3hxjmOjtxb" +
            "TgTq1rGYKbxMvfYJyZqD85sIZ3thtDpE+8OZnOZGZTw4lkhfz0TL835NUO9w6SJo" +
            "J0bkr76OsIMYpSVCmUPYR8ADADCI91csPiEBdchEzH4fAHCDUbpEFKXuqQJ/TBc9" +
            "04LSz3lWc07uchJ3TPW5JvgBZ2EXB+8Ui2x1oPACsLUp2DCVeIVrseNqo3Q82jkM" +
            "dIb+6iMeYJPTl4E2u1SpxiR/37rrR315if9rBdfFzoqT1Xtd+YVMb3c9KvmIhfGi" +
            "UrisFl6t/W14r9NRhj4PGRt2+kVQxWbuM7Zx8QKBgQDa0M/04xADxFUgyAIf2FDQ" +
            "nymeflIiZVkjT/dzHllB2NJC+zuphO/5pAhpQYnLavb3uJNCzcPuYOyOcVzJXRyS" +
            "35fCmKDdYroev2klCQhjUmMuyoFsgxUQC9F3TwzvUlmJppbrQrG/NzHq5Wgt3V39" +
            "pbXNU9wMu9iMTkpaiuKuAw==";

    @Override
    public String getAppid() {
        return APPID;
    }

    @Override
    public String getSecret() {
        return SECRET;
    }

    @Override
    public String getMchId() {
        return MCHID;
    }

    @Override
    public String getKey() {
        return KEY;
    }

    @Override
    public String getApiV3Key() {
        return API_V3_KEY;
    }

    @Override
    public String getBody() {
        return BODY;
    }

    @Override
    public String getDesc() {
        return DESC;
    }

    @Override
    public String getServiceId() {
        return SERVICE_ID;
    }

    @Override
    public String getSignType() {
        return SIGN_TYPE;
    }

    @Override
    public String getRefundDesc() {
        return REFUND_DESC;
    }

    @Override
    public String getSerialNo() {
        return SERIAL_NO;
    }

    @Override
    public String getPrivateContent() {
        return PRIVATE_CONTENT;
    }

    @Override
    public WXPayConfig getWXPayConfig() {
        try {
            return new BiaomaPayConfig();
        } catch (IOException e) {
            log.error("【error】：骉马商户配置文件初始化失败" +e.getMessage(), e);
        }
        return null;
    }
}
